package cn.z2huo.knowledge.concurrency.thinkinginjava.section_21_3.syncCodeBlock;

/**
 * 代码块同步
 */
class PairManager2 extends BasePairManager {

    @Override
    public void increment() {
        Pair temp;
        synchronized (this) {
            pair.incrementX();
            pair.incrementY();
            temp = getPair();
        }
        store(temp);
    }

}
